package com.speedricemanager.other.server;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.SoundPool;
import android.os.IBinder;

import com.jbm.core.client.MainCallback;
import com.jbm.core.common.ConnectAgent;
import com.jbm.core.iface.IFileObject;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;


public class KeepService extends Service {
    ServerModel model;
    public static   Thread t1;
    private final int USERMASSAGES = 0x004;
    private final int TIME = 0x0001;
    private static final String CHAT = "Chat";
    private static final String RECENT = "Recent";
    private static final String BUDDY = "BuddyList";

//    private ArrayList<ChatMsgEntity> arrayList;
    public static boolean isOn = false;
    private Context context;
    private Integer accounid;
    private String texts;
    private String name;
    public String Date;
    private   SoundPool soundPool;
    private float Volume;
    @Override
    public void onCreate() {
        super.onCreate();
        context=getApplicationContext();
         model=new ServerModel();
    }
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        model.init(getApplicationContext(),call);
        return super.onStartCommand(intent, flags, startId);
    }


    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }


    MainCallback call=new MainCallback() {
        @Override
        public void NewAccount(ConnectAgent ca) {

        }

        @Override
        public void RemoveAccount(Integer account_id) {

        }

        @Override
        public void UpdateAccount(boolean pullall, ConnectAgent ca) {

        }

        @Override
        public void OfflineAccount(int status, ConnectAgent ca) {

        }

        @Override
        public void NewDevice(ConnectAgent ca) {

        }

        @Override
        public void RemoveDevice(Integer account_id) {

        }

        @Override
        public void UpdateDevice(boolean pullall, ConnectAgent ca) {

        }

        @Override
        public void OfflineDevice(ConnectAgent ca) {

        }

        @Override
        public void NewText(Integer account_id, String text, long timestamp) {

        }

        @Override
        public void NewFile(Integer account_id, IFileObject fo, long timestamp) {

        }

        @Override
        public void NewPay(Integer account_id, String msg, BigDecimal fee, String paytype, long timestamp) {

        }

        @Override
        public void CGNewText(int cg_id, Integer account_id, String text, long timestamp) {

        }

        @Override
        public void CGNewFile(int cg_id, Integer account_id, IFileObject fo, long timestamp) {

        }

        @Override
        public void Belogout() {
            Intent in1 = new Intent();
            in1.setAction("com.merchant");
            in1.putExtra("type", "belogout");
            context.sendBroadcast(in1);

        }

        @Override
        public List<String> getAllIFace() {
            return Arrays.asList(("com.jbm.core.iface.IAcross|" +
                    "com.jbm.core.iface.ICallGroup|" +
                    "com.jbm.core.iface.IConnectAgent|" +
                    "com.jbm.core.iface.IFileObject|" +
                    "com.jbm.core.iface.IP2P|" +
                    "com.jbm.core.iface.IRegister|" +
                    "com.jbm.jsm.iface.AdminAuthorityEntity|" +
                    "com.jbm.jsm.iface.AdminEntity|" +
                    "com.jbm.jsm.iface.AdvertEntity|" +
                    "com.jbm.jsm.iface.ArbitrateEntity|" +
                    "com.jbm.jsm.iface.ArbitrateInfoEntity|" +
                    "com.jbm.jsm.iface.ArbitrateLogEntity|" +
                    "com.jbm.jsm.iface.AttachmentEntity|" +
                    "com.jbm.jsm.iface.AuthorityEntity|" +
                    "com.jbm.jsm.iface.BankCardEntity|" +
                    "com.jbm.jsm.iface.BlacklistEntity|" +
                    "com.jbm.jsm.iface.CodeCatalogEntity|" +
                    "com.jbm.jsm.iface.CodePropertyEntity|" +
                    "com.jbm.jsm.iface.ComplaintEntity|" +
                    "com.jbm.jsm.iface.ConsumConfigEntity|" +
                    "com.jbm.jsm.iface.DepositLogEntity|" +
                    "com.jbm.jsm.iface.DubiousEntity|" +
                    "com.jbm.jsm.iface.ExamAnswerEntity|" +
                    "com.jbm.jsm.iface.ExamEntity|" +
                    "com.jbm.jsm.iface.GeoInfoEntity|" +
                    "com.jbm.jsm.iface.GetcashEntity|" +
                    "com.jbm.jsm.iface.GoodsTypeEntity|" +
                    "com.jbm.jsm.iface.GroupEntity|" +
                    "com.jbm.jsm.iface.InvitationCodeEntity|" +
                    "com.jbm.jsm.iface.JinmiLogEntity|" +
                    "com.jbm.jsm.iface.LoginLogEntity|" +
                    "com.jbm.jsm.iface.MibaoLogEntity|" +
                    "com.jbm.jsm.iface.NiceNumberEntity|" +
                    "com.jbm.jsm.iface.NoticeEntity|" +
                    "com.jbm.jsm.iface.OperLogEntity|" +
                    "com.jbm.jsm.iface.OrderEntity|" +
                    "com.jbm.jsm.iface.PlatFundEntity|" +
                    "com.jbm.jsm.iface.RoomAdvertEntity|" +
                    "com.jbm.jsm.iface.RoomAuthorityEntity|" +
                    "com.jbm.jsm.iface.RoomEntity|" +
                    "com.jbm.jsm.iface.RoomFocusAuditEntity|" +
                    "com.jbm.jsm.iface.RoomFocusEntity|" +
                    "com.jbm.jsm.iface.SendMessageEntity|" +
                    "com.jbm.jsm.iface.SmallAccountEntity|" +
                    "com.jbm.jsm.iface.TaskEntity|" +
                    "com.jbm.jsm.iface.TaskGeoEntity|" +
                    "com.jbm.jsm.iface.TaskGoodsEntity|" +
                    "com.jbm.jsm.iface.TaskMouldEntity|" +
                    "com.jbm.jsm.iface.TaskMouldGeoEntity|" +
                    "com.jbm.jsm.iface.TaskMouldGoodsEntity|" +
                    "com.jbm.jsm.iface.UserAuthorityApplyEntity|" +
                    "com.jbm.jsm.iface.UserAuthorityEntity|" +
                    "com.jbm.jsm.iface.UserEntity|" +
                    "com.jbm.jsm.iface.IAplipay|" +
                    "com.jbm.jsm.iface.UserRoomEntity|" +
                    "com.jbm.jsm.iface.VerifyCodeEntity|" +
                    "com.jbm.jsm.iface.UserExamProgressEntity|" +
                    "com.jbm.jsm.iface.BankEntity|" +
                    "com.jbm.jsm.iface.TrustSmEntity|" +
                    "com.jbm.jsm.iface.Aribitrate|" +
                    "com.jbm.jsm.iface.OrderData|" +
                    "com.jbm.jsm.iface.JinmiLogEntity|" +
                    "com.jbm.jsm.iface.IAppVersion|" +
                    "com.jbm.jsm.iface.CheatdatabaseEntity|" +
                    "com.jbm.jsm.iface.Message|" +
                    "com.jbm.jsm.iface.SysConfigEntity|" +
                    "com.jbm.jsm.iface.ZhimaCert|" +
                    "com.jbm.jsm.iface.TaskMouldRequireEntity|" +
                    "com.jbm.jsm.iface.TaskRequireEntity"
            ).split("\\|"));

        }

        @Override
        public void ReConnect() {

        }

        @Override
        public void GPConfirmStart(int cg_id) {

        }

        @Override
        public void GPSelectTeam(int cg_id, String[] team) {

        }
        @Override
        public void newOrder(int order_id, int task_id, int from_id, String type, String msg, long timestamp, int msg_id) {

        }

         };
}
